<%@page import="Controller.User"%>
<%@page import="java.util.ArrayList"%>
<%@page import="POJO.*" %>
<%
HttpSession httpSession = request.getSession();

UserPOJO nguoiDung = null;
if(httpSession.getAttribute("user")!=null)
{
	nguoiDung = ( UserPOJO) httpSession.getAttribute("user");
}
%>
<!--  start nav-outer-repeat................................................................................................. START -->
<div class="nav-outer-repeat"> 
<!--  start nav-outer -->
<div class="nav-outer"> 

		<!-- start nav-right -->
		<div id="nav-right">
		
			<div class="nav-divider">&nbsp;</div>
			<div class="showhide-account"><img src="images/shared/nav/nav_myaccount.gif" width="93" height="14" alt="" /></div>
			<div class="nav-divider">&nbsp;</div>
			<a href="user?logout=9" id="logout" ><img src="images/shared/nav/nav_logout.gif" width="64" height="14" alt=""/></a>
			<div class="clear">&nbsp;</div>
		
			<!--  start account-content -->	
			<div class="account-content">
			<div class="account-drop-inner">
				<a href="" id="acc-details"><%= nguoiDung.getUsername() %></a>
				<div class="clear">&nbsp;</div>
				<div class="acc-line">&nbsp;</div>
				<a href="" id="acc-project"><%= nguoiDung.getType()%></a>
			</div>
			</div>
			<!--  end account-content -->
		
		</div>
		<!-- end nav-right -->
		
		<%
			ArrayList<String[]> arrMenu = new ArrayList<String[]>();
			String[][] menu = (String[][])request.getAttribute("menu");
			String[] item;
			for(int i=0; i< menu.length; i++)
			{
				item = menu[i];
				if(item[2]!= "")
				{
					arrMenu.add(item);
				}
			}
			String view = (String)request.getAttribute("view");
			String action = (String)request.getAttribute("action");
			item = arrMenu.get(0);
		%>
		
		<!--  start nav -->
		<div class="nav">
		<div class="table">
		<ul <%if(item[0].equals(view)) out.print("class='current'"); else out.print("class='select'"); %>><li><a href="<%=item[1]%>"><b><%=item[0] %></b><!--[if IE 7]><!--></a><!--<![endif]-->
		<!--[if lte IE 6]><table><tr><td><![endif]-->
		<div <%if(item[0].equals(view)) out.print("class='select_sub show'"); else out.print("class='select_sub'"); %>>
			<ul class="sub">
				<%if(!item[0].equals("Orders")){ %>
				<li <%if(action.equals("View")) out.print("class='sub_show'");%>><a href="<%=item[1]%>">View all <%=item[0].toLowerCase() %></a></li>
				<li <%if(!action.equals("View")) out.print("class='sub_show'");%>><a href="<%=item[1] + "?add"%>"><%="Add " + item[1]%></a></li>
				<%
				}
				else
				{
					if(action.equals("View"))
						
					{
				%>
					<li class="sub_show"><a href="<%=item[1]%>">View all <%=item[0].toLowerCase() %></a></li>
				 	
				<%
					}
					else
					{
				%>
					<li><a href="<%=item[1]%>">View all <%=item[0].toLowerCase() %></a></li>		 	
				 	<li class="sub_show" >View detail order</li>
				<%	
					}
				}
				%>
			</ul>
		</div>
		<!--[if lte IE 6]></td></tr></table></a><![endif]-->
		</li>
		</ul>
		
		<%
			for(int i=1; i< arrMenu.size(); i++)
			{
				item = arrMenu.get(i);
		%>
		<div class="nav-divider">&nbsp;</div>
		
				<ul <%if(item[0].equals(view)) out.print("class='current'"); else out.print("class='select'"); %>><li><a href="<%=item[1]%>"><b><%=item[0] %></b><!--[if IE 7]><!--></a><!--<![endif]-->
		<!--[if lte IE 6]><table><tr><td><![endif]-->
		<div <%if(item[0].equals(view)) out.print("class='select_sub show'"); else out.print("class='select_sub'"); %>>
			<ul class="sub">
				<%if(!item[0].equals("Orders")){ %>
				<li <%if(action.equals("View")) out.print("class='sub_show'");%>><a href="<%=item[1]%>">View all <%=item[0].toLowerCase() %></a></li>
				<li <%if(!action.equals("View")) out.print("class='sub_show'");%>><a href="<%=item[1] + "?add"%>"><%="Add " + item[1]%></a></li>
				<%
				}
				else
				{
					if(action.equals("View"))
						
					{
				%>
					<li class="sub_show"><a href="<%=item[1]%>">View all <%=item[0].toLowerCase() %></a></li>
				 	
				<%
					}
					else
					{
				%>
					<li><a href="<%=item[1]%>">View all <%=item[0].toLowerCase() %></a></li>		 	
				 	<li class="sub_show" ><a>View detail order</a></li>
				<%	
					}
				}
				%>
			</ul>
		</div>
		<!--[if lte IE 6]></td></tr></table></a><![endif]-->
		</li>
		</ul>
		<%	
			}
		%>
		
		<div class="clear"></div>
		</div>
		<div class="clear"></div>
		</div>
		<!--  start nav -->

</div>
<div class="clear"></div>
<!--  start nav-outer -->
</div>
<!--  start nav-outer-repeat................................................... END -->
